home *** CD-ROM | disk | FTP | other *** search
- Path: sun001.spd.dsccc.com!jmccarty
- From: jmccarty@sun1307.spd.dsccc.com (Mike McCarty)
- Newsgroups: comp.programming,comp.sys.sgi.misc,comp.lang.c
- Subject: Re: C pointer question.
- Date: 4 Apr 1996 22:53:38 GMT
- Organization: DSC Communications Corporation
- Message-ID: <4k1jti$igm@sun001.spd.dsccc.com>
- References: <315BFDBB.773C@wight.hursley.ibm.com> <31616BAF.5BAB@datalytics.com> <3162659B.6201@wight.hursley.ibm.com> <4ju6c5INN2ee@keats.ugrad.cs.ubc.ca>
- NNTP-Posting-Host: sun1307.spd.dsccc.com
-
- In article <4ju6c5INN2ee@keats.ugrad.cs.ubc.ca>,
- Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
- )In article <3162659B.6201@wight.hursley.ibm.com>,
- )Max Waterman <dwater@wight.hursley.ibm.com> wrote:
- )>Ie what are the arguments for :
- )>
- )>char name1,
- )> name2,
- )> name3;
- )>
- )>over :
- )>
- )>char name1;
- )>char name2;
- )>char name3;
- )>
- )>?
- )>
- )>Aren't they identical?
- )>
- )>Any compiler boffs out there know about this?
- )
- )These are identical. But if you put too many declarators onto one declaration
- )specifier string, an ANSI-compliant compiler may fail, because the standard
- )says that a compiler is only required to process declarations that have at
- )least 12 (AFAIR) declarators (if I interpreted the confusing paragraph
- )correctly: I'm sure this article will be followed up with some clarifications
- )and/or flames). This might be intended as a relief to parsers that build n-ary
- )trees, where the number of children that a parse tree node can have is a fixed
- )array contained in the node data structure:
-
- They are not guaranteed to be identical. I haven't seen anything in the
- standard that says that the same program must be produced by these
- differing sources. I have, in fact, used compilers which -did- produce
- different programs depending on such declarations.
-
- Mike
- --
- ----
- char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
-
- I don't speak for DSC. <- They make me say that.
-